<ui:composition template="/templates/main.xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich" >
		<ui:define name="body">
		<link rel="stylesheet" href="css/themes/redmond/jquery.ui.all.css" />
		<script src="js/ui/jquery.ui.position.js"></script>
		<script src="js/ui/jquery.ui.resizable.js"></script> 
		<script src="js/ui/jquery.ui.core.js"></script>
		<script src="js/ui/jquery.ui.widget.js"></script>
		<script src="js/ui/jquery.ui.dialog.js"></script>
		<script>
	$(function() {
		$( "#dialog" ).dialog({
			autoOpen: false,
			show: "blind",
			hide: "explode",
			width: 320,
			height: 250,
			modal: true
		});
	});
	</script>
		
		
			<style>
.tableStyle {
	width: 100%;
}
.rf-ds{
	   margin-top:10px;
	   margin-left:450px;
	}
</style>
		<rich:panel>
			<f:facet name="header">
				<h:outputText value="类别操作"></h:outputText>
			</f:facet>
			<h:form>
			<div align="right" style="padding-right:20px">
					<a href="addDocument.jsf" style="cursor:pointer">
					<img height="18" width="18" src="images/icons/add.png" />
								<font size="2"><b>添加文件</b></font>
					</a>			
			</div>
				<rich:dataTable value="#{fatherNode.fatherTree}" var="tree" id="table"
					rows="15" width="800" styleClass="tableStyle">
					<rich:column width="200" style="text-align:center">
						<f:facet name="header">
							<h:outputText value="名称" />
						</f:facet>

						<h:outputText value="#{tree.nodename}" />
					</rich:column>
					<rich:column width="200" style="text-align:center">
						<f:facet name="header">
							<h:outputText value="子菜单" />
						</f:facet>

						<h:outputText value="有" />
					</rich:column>
					<rich:column width="200" style="text-align:center">
						<f:facet name="header">
							<h:outputText value="进入子菜单" />
						</f:facet>
						<h:outputLink value="ShowChildMenu.jsf">
        					<h:outputText value="进入子菜单"></h:outputText>
        					<f:param value="#{tree.nodeid}" name="id"></f:param>
        				</h:outputLink>
					</rich:column>
					
					<rich:column style="text-align:center">
						<f:facet name="header">
							<h:outputText value="重命名" />
						</f:facet>
						<a onclick="$('#dialog').dialog( 'open' );" id="opener" href="renameTree.jsf?id=#{tree.nodeid}" target="info"><img height="20px" width="20px" src="images/icons/editefile.png" alt="重命名" /> </a>
					</rich:column>
					<rich:column style="text-align:center">
						<f:facet name="header">
							<h:outputText value="删除" />
						</f:facet>
						<a4j:commandLink render="table" action="#{treeMenuList.delFatherNode}" onclick="return confirm('删除目录将删除目录下的所有文件！确定要删除此目录吗？');">
							<img height="20px" width="20px" src="images/icons/delfile.png" alt="删除" />	
							<a4j:param name="nodeId" value="#{tree.nodeid}"
										assignTo="#{treeMenuList.nodeId}" />
						</a4j:commandLink>
					</rich:column>
					
					
					
				</rich:dataTable>
				<rich:dataScroller for="table" id="scp" align="right"
					renderIfSinglePage="true" maxPages="30"> 
					 <f:facet name="first">
                    <h:outputText value="first"/>
                     </f:facet>
                    <f:facet name="last">
                    <h:outputText value="last"/>
                     </f:facet>
                 </rich:dataScroller>
				
			</h:form>
		</rich:panel>
		  	<div id="dialog" title="重命名">	
				<iframe align="left"  frameborder="0" name="info" width="280px" height="180px;" />
			</div>
		  
		</ui:define>
	</ui:composition>